<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>创作</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/layui/css/layui.css?v=version_0.2">
    <link rel="stylesheet" href="/static/css/global.css?v=version_0.2">
    <link rel="stylesheet" href="/static/css/profile.css?v=version_0.2">

</head>

<body>

    <div id="header-bar"></div>

    <div class="layui-container fly-marginTop" id="page-content">
        
    </div>

    <div id="footer">
        
    </div>

    <script src="/static/layui/layui.js?v=version_0.2"></script>
    <script src="/static/js/xm-select.js?v=version_0.2"></script>
    <script>
        layui.config({
            version: "version_0.2"
            , base: '/static/mods/'
        }).extend({
            fly: 'index'
        }).use(['layer', 'jquery', 'app', 'my_base', 'fly'], function () {
            var $ = layui.jquery
                , layer = layui.layer;
            
            app = layui.app;
            app.init({
                contentElemId: '#page-content',
                config: {
                    // viewUrlPrefix: "/calendar/",
                    templatePath: "/profile/template/",
                    // viewUrlSuffix:'.html'
                },

                success: function () {
                    console.log('==== Index Success ====');
                    app.runTpl("header", { elem: "#header-bar" })
                    app.runTpl("footer", { elem: "#footer" })
                    // 核心扩展方法
                    app.base = layui.my_base;
                    app.base.routeDefine([
                        // 管理平台
                        // 首页 日历列表+内容
                        {
                            path: '/fly',
                            url: "/profile/pages/writing_editor/fly.html"
                        },

                        {
                            path: '/iframe',
                            url: "/profile/pages/writing_editor/iframe.html"
                        },

                        {
                            path: '/editor',
                            url: "/profile/pages/writing_editor/editor.html"
                        },
                    ])
                    var url = app.getRoute();
                    if (url) {
                        app.goToPage(url);
                    } else {
                        app.go("/editor");
                    }
                }
            })

        })
    </script>

</body>

</html>